﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.WmsManagement;

namespace Digitalmes.Model.WmsManagement
{
    /// <summary>
    /// 库存调拨
    /// </summary>
	[Table("StoreTransfer")]

    [Display(Name = "_Model.StoreTransfer")]
    public class StoreTransfer : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._StoreTransfer._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._StoreTransfer._Sheet")]
        [Comment("调拨单号")]
        public StoreTransferSheet Sheet { get; set; }
        [Display(Name = "_Model._StoreTransfer._Sheet")]
        [Comment("调拨单号")]
        public long? SheetId { get; set; }
        [Display(Name = "_Model._StoreTransfer._SheetCode")]
        [Comment("调拨单号")]
        [NotMapped]
        public string SheetCode { get; set; }
        [Display(Name = "_Model._StoreTransfer._MaterialName")]
        [Comment("调拨物料")]
        [NotMapped]
        public string MaterialName { get; set; }
        [Display(Name = "_Model._StoreTransfer._Material")]
        [Comment("调拨物料")]
        public MaterialDoc Material { get; set; }
        [Display(Name = "_Model._StoreTransfer._Material")]
        [Comment("调拨物料")]
        public long? MaterialId { get; set; }
        [Display(Name = "_Model._StoreTransfer._Qty")]
        [Comment("调拨数量")]
        [Precision(18,2)]
        [Required(ErrorMessage = "Validate.{0}required")]
        public decimal? Qty { get; set; }
        [Display(Name = "_Model._StoreTransfer._TransferDate")]
        [Comment("调拨时间")]
        public DateTime? TransferDate { get; set; }
        [Display(Name = "_Model._StoreTransfer._Status")]
        [Comment("状态")]
        public FormStatusEnum? Status { get; set; }
        [Display(Name = "_Model._StoreTransfer._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
